<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	FindResults
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Find A Patient</h2><br />
    
    
    <div>
        You Searched for<br />
        Name: <strong><%= ViewData["fname"] %> <%=ViewData["lname"] %></strong><br />
        Cell Phone Number: <strong><%=ViewData["cellNumber"] %></strong><br />
        Procedure Date: <strong><%= ViewData["procedureDate"]%></strong><br />
        
        <h3>Possible Matches</h3>
    </div>
    
	<div class="innerContent">
	    <% if (((IEnumerable<ProjectMadaktariMVC.Models.Patient>)ViewData["patientList"]).Count() != 0)
        {%>
		<table class="episode_table">
			<tr>
				<th>First Name</th>
				<th>Last Name</th>
				<th>Patient Number</th>
				<th>Last Procedure Date</th>
			</tr>
	
	    <% int alternator = 1;
        foreach (ProjectMadaktariMVC.Models.Patient p in (IEnumerable<ProjectMadaktariMVC.Models.Patient>)ViewData["patientList"])
        {
            if (alternator == 0)
            {
                alternator = 1;
            }
            else
            {
                alternator = 0;
            }
            %>
	  
		<tr class="alternate-<%= alternator%>">
		 <td><%= Html.ActionLink(p.fName, "View", new { id = p.patientID })%></td>
		 <td><%= Html.ActionLink(p.lName, "View", new { id = p.patientID })%></td>
		 <td><%= p.recordNumber%></td>
		 <td><%= p.GetLastDate() == DateTime.MaxValue ? "--" : p.GetLastDate().ToString("MM/dd/yyyy")%></td>
	    </tr>
		<!--  Use episode Table for the table coloring-->
	  <% } %>
	  </table>
	  <% }
        else
        { %>
        <em>No Patients Found! </em><br /><br />
         <%} %>
        
   
</div>

<%= Html.ActionLink("Search Again", "Find") %>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="Header" runat="server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="TableSubheader" runat="server">
</asp:Content>
